#include  <iostream>
#include  <stdlib.h>
#include <cmath>
using namespace std;
#include "stdinc.h"


int main( int argc, char *argv[] ) 
{ 
	cout<<"This program generate a batch file for the expremental test of barnehut and fmm with octree and compress octree " <<endl;

	cout<<"Most important part of this batch file is the number of particle"<<endl;

	int Nparticle=1000;
	cout<<"Number of particle "; cin >> Nparticle;
	//all k for file name are lowercase 

	int Stepsize=3;
	cout<<"Number of simulation time step ";cin>>Stepsize;

	//char choice;
	
	//cout<<"Sometimes I dont want to run the particle particle code ";
	//cout<<"So do you want to run particle_particle code ? <Y/N> ";cin >> choice;
	
//	bool isDirect_code;

/*	if ( (choice == 'Y') || (choice=='y') ) 
		isDirect_code = true;
	else 
		isDirect_code = false;
*/

	char filename[20]="calistir.sh";

	ofstream outfile( filename  ) ;

	//if ( isDirect_code )
	outfile<<"../particle_particle.exe "<< Nparticle / 1000  << "k.dat debug"<<endl;

	outfile<<"../barneshut.exe "<<Nparticle / 1000 << "k.dat 1 1" <<endl;
	outfile<<"../barneshut.exe "<<Nparticle / 1000 << "k.dat 0.9 1" <<endl;
	outfile<<"../barneshut.exe "<<Nparticle / 1000 << "k.dat 0.8 1" <<endl;
	outfile<<"../barneshut.exe "<<Nparticle / 1000 << "k.dat 0.75 1" <<endl;
	outfile<<"../barneshut.exe "<<Nparticle / 1000 << "k.dat 0.7 1" <<endl;
	outfile<<"../barneshut.exe "<<Nparticle / 1000 << "k.dat 0.65 1" <<endl;

	outfile<<"../compressBarneshut.exe "<<Nparticle / 1000 << "k.dat 1 1" <<endl;
	outfile<<"../compressBarneshut.exe "<<Nparticle / 1000 << "k.dat 0.9 1" <<endl;
	outfile<<"../compressBarneshut.exe "<<Nparticle / 1000 << "k.dat 0.8 1" <<endl;
	outfile<<"../compressBarneshut.exe "<<Nparticle / 1000 << "k.dat 0.75 1" <<endl;
	outfile<<"../compressBarneshut.exe "<<Nparticle / 1000 << "k.dat 0.7 1" <<endl;
	outfile<<"../compressBarneshut.exe "<<Nparticle / 1000 << "k.dat 0.65 1" <<endl;

	outfile<<"../fmm.exe "<< Nparticle / 1000 << "k.dat 2 1"<<endl;
	outfile<<"../fmm.exe "<< Nparticle / 1000 << "k.dat 3 1"<<endl;
	outfile<<"../fmm.exe "<< Nparticle / 1000 << "k.dat 4 1"<<endl;
	outfile<<"../fmm.exe "<< Nparticle / 1000 << "k.dat 5 1"<<endl;
	outfile<<"../fmm.exe "<< Nparticle / 1000 << "k.dat 6 1"<<endl;

	outfile<<"../compressFMM.exe "<< Nparticle / 1000 << "k.dat 2 1"<<endl;
	outfile<<"../compressFMM.exe "<< Nparticle / 1000 << "k.dat 3 1"<<endl;
	outfile<<"../compressFMM.exe "<< Nparticle / 1000 << "k.dat 4 1"<<endl;
	outfile<<"../compressFMM.exe "<< Nparticle / 1000 << "k.dat 5 1"<<endl;
	outfile<<"../compressFMM.exe "<< Nparticle / 1000 << "k.dat 6 1"<<endl;

	//snapFORCE___PP-20K-STEP-1.dat
	//outfile.setf
	for ( int i=1;i<=Stepsize;i++)
	{
																				//snapFORCE__BH1K-teta1.00-pLEAF1-Step-3.dat
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__BH"<<Nparticle/1000 << "K-teta"<<"1.00"<<"-pLEAF1-Step-"<<i<<".dat" << endl;
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__COMPBH"<<Nparticle/1000 << "K-teta"<<"1.00"<<"-pLEAF1-Step-"<<i<<".dat" << endl;
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__BH"<<Nparticle/1000 << "K-teta"<<"0.90"<<"-pLEAF1-Step-"<<i<<".dat" << endl;
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__COMPBH"<<Nparticle/1000 << "K-teta"<<"0.90"<<"-pLEAF1-Step-"<<i<<".dat" << endl;
		
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__BH"<<Nparticle/1000 << "K-teta"<<"0.80"<<"-pLEAF1-Step-"<<i<<".dat" << endl;
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__COMPBH"<<Nparticle/1000 << "K-teta"<<"0.80"<<"-pLEAF1-Step-"<<i<<".dat" << endl;

		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__BH"<<Nparticle/1000 << "K-teta"<<"0.75"<<"-pLEAF1-Step-"<<i<<".dat" << endl;
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__COMPBH"<<Nparticle/1000 << "K-teta"<<"0.75"<<"-pLEAF1-Step-"<<i<<".dat" << endl;

		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__BH"<<Nparticle/1000 << "K-teta"<<"0.70"<<"-pLEAF1-Step-"<<i<<".dat" << endl;
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__COMPBH"<<Nparticle/1000 << "K-teta"<<"0.70"<<"-pLEAF1-Step-"<<i<<".dat" << endl;

		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__BH"<<Nparticle/1000 << "K-teta"<<"0.65"<<"-pLEAF1-Step-"<<i<<".dat" << endl;
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__COMPBH"<<Nparticle/1000 << "K-teta"<<"0.65"<<"-pLEAF1-Step-"<<i<<".dat" << endl;

		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__BH"<<Nparticle/1000 << "K-teta"<<"0.60"<<"-pLEAF1-Step-"<<i<<".dat" << endl;
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__COMPBH"<<Nparticle/1000 << "K-teta"<<"0.60"<<"-pLEAF1-Step-"<<i<<".dat" << endl;
																				  //snapFORCE__BH1K-teta1.00-pLEAF1-Step-3.dat	
		
		

		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__FMM"<<Nparticle/1000 << "K-p"<<"1"<<"-pLEAF1-Step-"<<i<<".dat" << endl;
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__COMPFMM"<<Nparticle/1000 << "K-p"<<"1"<<"-pLEAF1-Step-"<<i<<".dat" << endl;

		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__FMM"<<Nparticle/1000 << "K-p"<<"2"<<"-pLEAF1-Step-"<<i<<".dat" << endl;
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__COMPFMM"<<Nparticle/1000 << "K-p"<<"2"<<"-pLEAF1-Step-"<<i<<".dat" << endl;


		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__FMM"<<Nparticle/1000 << "K-p"<<"3"<<"-pLEAF1-Step-"<<i<<".dat" << endl;
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__COMPFMM"<<Nparticle/1000 << "K-p"<<"3"<<"-pLEAF1-Step-"<<i<<".dat" << endl;

		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__FMM"<<Nparticle/1000 << "K-p"<<"4"<<"-pLEAF1-Step-"<<i<<".dat" << endl;
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__COMPFMM"<<Nparticle/1000 << "K-p"<<"4"<<"-pLEAF1-Step-"<<i<<".dat" << endl;

		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__FMM"<<Nparticle/1000 << "K-p"<<"5"<<"-pLEAF1-Step-"<<i<<".dat" << endl;
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__COMPFMM"<<Nparticle/1000 << "K-p"<<"5"<<"-pLEAF1-Step-"<<i<<".dat" << endl;

		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__FMM"<<Nparticle/1000 << "K-p"<<"6"<<"-pLEAF1-Step-"<<i<<".dat" << endl;	
		outfile<<"../compare.exe snapFORCE__PP-"<<Nparticle/1000 <<"K-STEP-" << i << ".dat snapFORCE__COMPFMM"<<Nparticle/1000 << "K-p"<<"6"<<"-pLEAF1-Step-"<<i<<".dat" << endl;



	}


	
	outfile.close();







    return 0; 
}
